package org.dromara.pay.service.impl;

import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.dromara.business.service.BusinessConfigService;
import org.dromara.common.core.service.WxOrderService;
import org.dromara.pay.constant.LogisticsType;
import org.dromara.pay.service.TopUpService;
import org.dromara.pay.util.WxOrderUtil;
import org.dromara.system.domain.SysUser;
import org.dromara.system.service.ISysUserService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 * 发货信息录入接口
 *
 * @author Lion Li
 */
@RequiredArgsConstructor
@Service
public class WxOrderServiceImpl implements WxOrderService {
    @Resource
    @Lazy
    private TopUpService topUpService;
    private final BusinessConfigService configService;
    private final ISysUserService userService;
//    @Lazy
//    @Resource
//    private OrderService orderService;

    @Override
    public void uploadShippingInfo(Long userId, String transactionId) {
        Integer type = LogisticsType.THREE_VIRTUAL_GOODS;
        SysUser user = userService.getById(userId);
        String itemDesc = "余额充值";
        WxOrderUtil.uploadShippingInfo(transactionId, type, itemDesc, user.getOpenid());
    }
}
